using B.S.XZYData.Api.Read.Application.Command.WorkReport;
using MediatR;
using Microsoft.AspNetCore.Mvc;
using System.Threading.Tasks;

namespace B.S.XZYData.Api.Read.Controllers
{
    /// <summary>
    /// 报工信息
    /// </summary>
    [ApiController]
    [Route("api/[controller]/[action]")]
    public class WorkReportController : ControllerBase
    {
        private readonly IMediator _mediator;

        public WorkReportController(IMediator mediator)
        {
            _mediator = mediator;
        }

        /// <summary>
        /// 报工分页查询（复杂查询，使用Request Body）
        /// </summary>
        /// <param name="command">查询条件</param>
        /// <returns>分页数据</returns>
        [HttpGet]
        public async Task<IActionResult> SearchWorkReport([FromQuery] QueryWorkReportCommand command)
        {
            var result = await _mediator.Send(command);
            return Ok(result);
        }
    }
} 